import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { LendService } from './lend.service';
import { CreateDto } from './dto/create.dto'
import { GetLendsDto } from './dto/get-lend.dto'
import { RemoveDto } from './dto/remove.dto'
import { UpdateDto } from './dto/update.dto'

@Controller('lends')
export class LendController {
  constructor(private readonly lendService: LendService) { }

  @Post("createLend")
  async createLend(@Body() createDto: CreateDto) {
    return this.lendService.createLend(createDto);
  }

  @Get("getLendsByUserId")
  async getLendsByUserId(@Query() getLendsDto: GetLendsDto) {
    return this.lendService.getLendsByUserId(getLendsDto);
  }

  @Post("updateLendByDataId")
  async updateLendByDataId(@Body() updateDto: UpdateDto) {
    return this.lendService.updateLendByDataId(updateDto);
  }

  @Post("removeLendsByDataIds")
  async removeLendsByDataIds(@Body() removeDto: RemoveDto) {
    return this.lendService.removeLendsByDataIds(removeDto);
  }

}